from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers.core import Activation
from keras.layers.core import Flatten
from keras.layers.core import Dense
from keras import backend as kes

class ShallowNet:
    @staticmethod
    def build(width,height,depth,classes):
        # initialize the mode along with the input shape to be "channels last"
        model = Sequential()
        inputShape = (height,width,depth)

        # if we are using "channels first",update the input shape
        if kes.image_data_format() == "channels_first":
            inputShape = (depth,height,width)

        model.add(Conv2D(32,(3,3),padding="same",input_shape=inputShape))
        model.add(Activation("relu"))

        # softmax classifier
        model.add(Flatten())
        model.add(Dense(classes))
        model.add(Activation("softmax"))

        return model
